﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class TV
    {
        private List<Channel> channels = new List<Channel>();
        private int currentChannel;

        public TV()
        {
            for (int number = 1; number < 6; number++)
            {
                channels.Add(new Channel(number, "Channel " + number));
            }
        }

        public void PrintChannelList()
        {
            foreach (var channel in channels)
            {
                channel.PrintChannelInfo();
            }
        }

        public void ShiftChannelUp()
        {
            if (currentChannel == channels.Count - 1)
                currentChannel = 0;
            else
                currentChannel++;
        }

        public void ShiftChannelDown()
        {
            if (currentChannel == 0)
                currentChannel = channels.Count - 1;
            else
                currentChannel--;
        }

        public void ShowCurrentChannel()
        {
            channels[currentChannel].PrintChannelInfo();
        }

    }
}
